package com.linkwechat.wecom.service.impl;

import com.linkwechat.wecom.domain.SysFileInfo;
import com.linkwechat.wecom.mapper.SysFileInfoMapper;
import com.linkwechat.wecom.service.ISysFileInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
//import com.linkwechat.mapper.SysFileInfoMapper;
//import com.linkwechat.domain.SysFileInfo;
//import com.linkwechat.service.ISysFileInfoService;

import java.util.List;
import java.util.Map;

/**
 * 文件信息Service业务层处理
 *
 * @author ruoyi
 * @date 2022-01-03
 */
@Service
public class SysFileInfoServiceImpl extends ServiceImpl<SysFileInfoMapper, SysFileInfo> implements ISysFileInfoService {

    @Override
    public List<SysFileInfo> queryList(SysFileInfo sysFileInfo) {
        LambdaQueryWrapper<SysFileInfo> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(sysFileInfo.getFileName())){
            lqw.like(SysFileInfo::getFileName ,sysFileInfo.getFileName());
        }
        if (sysFileInfo.getFileStatus() != null){
            lqw.eq(SysFileInfo::getFileStatus ,sysFileInfo.getFileStatus());
        }
        if (StringUtils.isNotBlank(sysFileInfo.getFilePath())){
            lqw.eq(SysFileInfo::getFilePath ,sysFileInfo.getFilePath());
        }
        return this.list(lqw);
    }
}
